package com.sushengren.easyword.converters;

import com.sushengren.easyword.enums.DataTypeEnum;
import com.sushengren.easyword.model.WriteData;

/**
 * 图片类型转换
 *
 * @author sushengren
 */
public class PictureConverter implements Converter {

    @Override
    public WriteData convertToWriteData(String key, Object obj) {
        WriteData writeData = new WriteData(key);
        writeData.setKey(key);
        writeData.setValue(obj);
        writeData.setDataType(DataTypeEnum.PICTURE);
        if (obj instanceof String) {
            writeData.setStringValue((String) obj);
        }
        return writeData;
    }

}
